/*
 * @Author: zhangfeng
 * @Date: 2024-01-12 15:34:01
 * @LastEditTime: 2024-01-12 16:53:33
 * @LastEditors: zhangfeng
 * @Description:
 * @FilePath: \nodeapi\src\model\article.modle.js
 * © 2023 张峰，All rights reserved.
 */
const { DataTypes } = require("sequelize");

const seq = require("../db/seq");

const Article = seq.define(
  "zd_article",
  {
    createBy: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "创建人",
    },
    articleTitle: {
      type: DataTypes.STRING,
      allowNull: false,
      unique: true,
      comment: "标题",
    },
    articleType: {
      type: DataTypes.INTEGER,
      allowNull: false,
      comment: "文章类型（html，markdown）",
    },
    articleImage: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "封面图片",
    },
    articleSummary: {
      type: DataTypes.STRING,
      allowNull: true,
      comment: "文章摘要",
    },
    articleContent: {
      type: DataTypes.TEXT,
      allowNull: false,
      comment: "文章内容",
    },
  },
  {
    paranoid: true,
  }
);
// Article.sync({ force: false });
module.exports = Article;
